package simple.demo.spel.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

public class Hello {
	private int value;
	@Value(" #{systemProperties['user.region']} ")
	private String locale;
	@Value(" #{systemProperties['user.home']} ")
	private String home;
	
	private final String javaHome;
	
	@Autowired
	public Hello(@Value( "#{ systemProperties['java.home'] }" ) 
			String javaHome) {
		this.javaHome = javaHome;
	}
	
	public void setValue(int value) {
		this.value = value;
	}
	
	public int getValue() {
		return value;
	}

	@Override
	public String toString() {
		return String.format("value = %d, locale = %s, home = %s, javaHome = %s",
				value, locale, home, javaHome);
	}
	
	
}
